-
Notifications
You must be signed in to change notification settings - Fork 0
Jan26 extended logging + AI #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ports in index.node.ts; add comprehensive Copilot instructions and build guidelines
- Removed unused peer dependency 'pino-pretty' from peerDependencies. - Cleaned up devDependencies by removing 'barrelsby' and 'typescript-eslint' duplicate entry. - Added '@types/luxon' and '@types/node' to devDependencies for better type support. - Removed the import of '@rollup/plugin-commonjs' from rollup.config.js as it was not being used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request refactors the logging API in the shared TypeScript library, introduces new utility functions for URL validation and timestamp manipulation, and adds comprehensive project documentation. The major focus is on replacing the old AppLogger class with stateless logging functions that directly use pino, removing the dependency on pino-pretty from the codebase.
Key Changes:
- Complete refactor of the logging API from a class-based approach to functional approach with individual logging functions
- Addition of URL validation helpers (
isUrl,isArrayOfUrls) and timestamp utility (nowPlusTime) - Comprehensive project documentation including coding, build, and testing instructions for AI assistants
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
src/node/logging/logger.ts |
Replaced AppLogger class with stateless logging functions; refactored to use pino directly without pretty-printing |
src/index.node.ts |
Updated exports to reflect new logging function names |
src/index.browser.ts |
Added exports for new URL and timestamp utility functions |
src/globals/coding/code.formating.ts |
Added isUrl and isArrayOfUrls helper functions for URL validation |
src/globals/coding/code.dates.ts |
Added nowPlusTime function to calculate future/past timestamps |
package.json |
Removed pino-pretty, @rollup/plugin-commonjs, and barrelsby dependencies; reordered dev dependencies |
rollup.config.js |
Removed unused @rollup/plugin-commonjs import |
eslint.config.mjs |
Disabled @typescript-eslint/no-unused-vars rule |
AGENTS.md |
Added comprehensive repository documentation for AI assistants |
.github/copilot-instructions.md |
Added GitHub Copilot-specific instructions (duplicate of AGENTS.md) |
.github/instructions/*.md |
Added detailed coding, testing, and build instructions |
package-lock.json |
Automated dependency updates and removals |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AGENTS.md
Outdated
| Shared TypeScript library for backend and frontend applications of the Panther project. | ||
|
|
||
| ## Important Rule | ||
| Read and folow all `.github/instructions/*` files for code and practises clarity. |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "folow" should be "follow".
AGENTS.md
Outdated
|
|
||
| # Testing and Linting | ||
| - Using Vitest as the test framework and typescript for type safety. | ||
| - Please folow `.github/instructions/testing.instructions.md` for testing-related guidelines. |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "folow" should be "follow".
.github/copilot-instructions.md
Outdated
| Shared TypeScript library for backend and frontend applications of the Panther project. | ||
|
|
||
| ## Important Rule | ||
| Read and folow all `.github/instructions/*` files for code and practises clarity. |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "folow" should be "follow".
| applyTo: "src/**/*.ts" | ||
| --- | ||
|
|
||
| # General programming style guidlines for this repository |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "guidlines" should be "guidelines".
| # General programming style guidlines for this repository | |
| # General programming style guidelines for this repository |
AGENTS.md
Outdated
| - Functions to parse and validate Arrows.app JSON format (`src/node/api/parse.arrows.json.ts`). | ||
| - Utility functions for parsing and validating raw input data (`src/node/api/parse.raw.input.ts`). | ||
| - Global types and interfaces shared between frontend and backend (`src/globals/arrows/`, `src/globals/panther/`). | ||
| - General shared coding helpers and formaters (`src/globals/coding/`) |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "formaters" should be "formatters".
| - General shared coding helpers and formaters (`src/globals/coding/`) | |
| - General shared coding helpers and formatters (`src/globals/coding/`) |
.github/copilot-instructions.md
Outdated
| - Functions to parse and validate Arrows.app JSON format (`src/node/api/parse.arrows.json.ts`). | ||
| - Utility functions for parsing and validating raw input data (`src/node/api/parse.raw.input.ts`). | ||
| - Global types and interfaces shared between frontend and backend (`src/globals/arrows/`, `src/globals/panther/`). | ||
| - General shared coding helpers and formaters (`src/globals/coding/`) |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "formaters" should be "formatters".
| - General shared coding helpers and formaters (`src/globals/coding/`) | |
| - General shared coding helpers and formatters (`src/globals/coding/`) |
src/node/logging/logger.ts
Outdated
| export const loggyInfo = (label: string, message: string, options: Record<string, any> = {}): void => { | ||
| buildBaseLogger().info({ ...options, label, message }) |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new pino logger instance is created on every log call by invoking buildBaseLogger(). This is inefficient and should be avoided. Consider creating the logger once at module scope and reusing it across all logging functions. This will improve performance and reduce memory overhead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
src/node/logging/logger.ts
Outdated
| route: string, | ||
| method: string, | ||
| options: Record<string, any> = {}) => { | ||
| loggyInfo("Request Recived", `${method}: ${route}`, options) |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in the label: "Recived" should be "Received".
| loggyInfo("Request Recived", `${method}: ${route}`, options) | |
| loggyInfo("Request Received", `${method}: ${route}`, options) |
.github/copilot-instructions.md
Outdated
|
|
||
| # Testing and Linting | ||
| - Using Vitest as the test framework and typescript for type safety. | ||
| - Please folow `.github/instructions/testing.instructions.md` for testing-related guidelines. |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "folow" should be "follow".
…scope Co-authored-by: barluq <[email protected]>
Co-authored-by: barluq <[email protected]>
Optimize logger by creating single pino instance at module scope
This pull request introduces several improvements and clarifications to the shared TypeScript library, focusing on logging utilities, code helpers, and project documentation. The most important changes include a complete refactor of the logging API for Node.js, new utility functions for working with URLs and timestamps, and the addition of comprehensive coding, build, and testing instructions to the repository. There are also updates to package dependencies and exports for better clarity and usability.
Logging API Refactor:
AppLoggerclass andprettystream with a set of simple, stateless logging functions (loggyInfo,loggyDebug,loggyWarn,loggyTrace,loggyFatal,loggyAppStart,loggyRequestReceived,loggyResponseSent) insrc/node/logging/logger.ts, standardizing logging across the project. These functions are now exported directly fromsrc/index.node.tsinstead of the class. [1] [2]New Utility Functions:
isUrlandisArrayOfUrlshelpers tosrc/globals/coding/code.formating.tsfor validating URLs and arrays of URLs, and exported them insrc/index.browser.ts. [1] [2]nowPlusTimeinsrc/globals/coding/code.dates.tsto get a future/past timestamp by adding seconds, with export insrc/index.browser.ts. [1] [2]Documentation and Coding Guidelines:
.github/copilot-instructions.md,AGENTS.md,.github/instructions/build.instructions.md,.github/instructions/coding.instructions.md, and.github/instructions/testing.instructions.mdto clarify project structure, coding style, build strategy, and testing practices. [1] [2] [3] [4]Package and Build Configuration:
package.jsonto clean up peer and dev dependencies, add missing type packages, and ensuretypescript-eslintis listed as a dev dependency. Removed unnecessarypino-prettyand@rollup/plugin-commonjs. [1] [2] [3]ESLint Configuration:
@typescript-eslint/no-unused-varsrule ineslint.config.mjsfor more flexible development.